Skip to content

ci: add e2e workflow to deploy plugin to Mattermost and verify it starts#208

Merged
lieut-data merged 4 commits intomasterfrom
add-e2e-deploy-check
Apr 10, 2026
Merged

ci: add e2e workflow to deploy plugin to Mattermost and verify it starts#208
lieut-data merged 4 commits intomasterfrom
add-e2e-deploy-check

Conversation

@lieut-data
Copy link
Copy Markdown
Member

@lieut-data lieut-data commented Apr 10, 2026

Summary

  • Adds a new e2e GitHub Actions workflow that spins up a Mattermost Enterprise Edition container backed by PostgreSQL, deploys the demo plugin, and asserts it appears in the active plugins list
  • Builds only the linux-amd64 server binary (via MM_SERVICESETTINGS_ENABLEDEVELOPER=true) to keep the job fast
  • Dumps Mattermost container logs automatically on any failure to aid debugging

Test plan

  • Verify the e2e workflow passes on this PR

@lieut-data lieut-data marked this pull request as ready for review April 10, 2026 17:56
@lieut-data lieut-data requested a review from DHaussermann April 10, 2026 17:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow file has been added to automate end-to-end deployment verification. The workflow provisions a PostgreSQL database and Mattermost server, deploys a plugin using pluginctl, and verifies the plugin's active status through REST API calls.

Changes

Cohort / File(s) Summary
E2E Deployment Verification Workflow
.github/workflows/e2e.yml
New workflow triggered on pushes to master and pull requests. Provisions PostgreSQL 16 and Mattermost Enterprise containers, polls for service health, creates admin user via mmctl, deploys plugin using pluginctl, and verifies plugin activation via REST API endpoint checks. Includes failure handling with conditional container log output.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a CI workflow for end-to-end deployment and verification of the plugin to Mattermost.
Description check ✅ Passed The description is directly related to the changeset, providing relevant implementation details about the workflow, build configuration, and failure handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-e2e-deploy-check

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/e2e.yml (1)

32-37: Derive PLUGIN_ID from the manifest once and reuse it everywhere.

build/setup.mk:13-17 already resolves the plugin ID from plugin.json, but this workflow keeps separate copies in the job env, config payload, deploy step, and assertion. If the manifest ID changes, make dist will build the new bundle while the rest of this workflow still targets the old ID.

One way to keep a single source of truth
     env:
       MM_SITEURL: http://localhost:8065
       MM_ADMIN_USERNAME: admin
       MM_ADMIN_PASSWORD: Admin_1234!
-      PLUGIN_ID: com.mattermost.demo-plugin

+      - name: Resolve plugin ID
+        run: echo "PLUGIN_ID=$(./build/bin/manifest id)" >> "$GITHUB_ENV"
...
-          curl -sf -X PUT ${{ env.MM_SITEURL }}/api/v4/config/patch \
+          cat >/tmp/plugin-config.json <<EOF
+          {
+            "PluginSettings": {
+              "Plugins": {
+                "$PLUGIN_ID": {
+                  "username": "demouser",
+                  "channelname": "demo",
+                  "lastname": "User"
+                }
+              }
+            }
+          }
+          EOF
+          curl -sf -X PUT ${{ env.MM_SITEURL }}/api/v4/config/patch \
             -H "Authorization: Bearer $TOKEN" \
             -H 'Content-Type: application/json' \
-            -d '{
-              "PluginSettings": {
-                "Plugins": {
-                  "com.mattermost.demo-plugin": {
-                    "username": "demouser",
-                    "channelname": "demo",
-                    "lastname": "User"
-                  }
-                }
-              }
-            }'
+            --data `@/tmp/plugin-config.json`

Also applies to: 104-117, 126-126, 145-150

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/e2e.yml around lines 32 - 37, The workflow currently
hardcodes PLUGIN_ID in multiple places; change it to derive the ID once from
plugin.json and reuse that variable across the job (replace the env PLUGIN_ID,
the config payload, the deploy step, and the assertion). Read the plugin
manifest (plugin.json) at job runtime (similar to build/setup.mk's logic) and
export the derived value as a single PLUGIN_ID environment variable for the job,
then reference that environment variable everywhere instead of hardcoding the
ID.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/e2e.yml:
- Line 71: Replace the mutable image reference
"mattermost/mattermost-enterprise-edition:latest" used for the Mattermost
service with a pinned release tag and digest (for example matching the
plugin.json min_server_version 7.9.0), i.e. change the image string to a
specific "mattermost/mattermost-enterprise-edition:<version>@sha256:<digest>" so
the CI is reproducible; locate the literal
"mattermost/mattermost-enterprise-edition:latest" in the e2e.yml service
definition and update it to the chosen pinned tag+digest (or add a
variable/lookup that resolves to a pinned digest) ensuring it matches a tested
Mattermost release.

---

Nitpick comments:
In @.github/workflows/e2e.yml:
- Around line 32-37: The workflow currently hardcodes PLUGIN_ID in multiple
places; change it to derive the ID once from plugin.json and reuse that variable
across the job (replace the env PLUGIN_ID, the config payload, the deploy step,
and the assertion). Read the plugin manifest (plugin.json) at job runtime
(similar to build/setup.mk's logic) and export the derived value as a single
PLUGIN_ID environment variable for the job, then reference that environment
variable everywhere instead of hardcoding the ID.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57bb6991-bc72-426a-b4c8-d48dd6cec49d

📥 Commits

Reviewing files that changed from the base of the PR and between 96fc3e0 and d127ba5.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yml

Copy link
Copy Markdown

@DHaussermann DHaussermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and passed
@lieut-data can see the E2E check is green.

Image

There's not much more in terms of functional testing I can think to do as it's mostly a build time change.

LGTM!

@DHaussermann DHaussermann added the 4: Reviews Complete All reviewers have approved the pull request label Apr 10, 2026
@lieut-data lieut-data merged commit e388d65 into master Apr 10, 2026
4 checks passed
@lieut-data lieut-data deleted the add-e2e-deploy-check branch April 10, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4: Reviews Complete All reviewers have approved the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants